package net.lucamasini.ricette.client.ricette;

import net.lucamasini.ricette.client.ingredienti.IngredienteProxy;

import com.google.gwt.editor.client.Editor;
import com.google.gwt.place.shared.Place;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.view.client.ListDataProvider;

public interface RicetteDialogView extends IsWidget, Editor<RicettaProxy> {
	
	void setPresenter(Presenter presenter);
	
	void showAndCenter();
	void hide();
	
	void clearIngredientiSelection();
	void clearIngredientiRicettaSelection();
	
	ListDataProvider<IngredienteProxy> fromDataProvider();
	ListDataProvider<IngredientiRicettaProxy> toDataProvider();
	
	interface Presenter {
		void goTo(Place place);

		void salvaRicetta();
		void addIngrediente(IngredienteProxy selectedObject);
		void removeIngrediente(IngredientiRicettaProxy selectedObject);
		String decodeIngrediente(IngredientiRicettaProxy ir);
	}

}
